/*
 * deque_filo.hpp
 *
 *  Created on: 26.07.2009
 *      Author: dmitryzinyakov
 */

#ifndef DEQUE_FILO_HPP_
#define DEQUE_FILO_HPP_

#include <assert.h>

namespace system
{
template<class T>
deque_filo<T>::deque_filo()
{
}

template<class T>
deque_filo<T>::~deque_filo()
{
}

template<class T>
void deque_filo<T>::push(T val)
{
	lock guard(mutex_);
	storage_.push_back(val);
}

template<class T>
T deque_filo<T>::pop()
{
	lock guard(mutex_);
	assert(!storage_.is_empty());
	return storage_.pop_front();
}

template<class T>
size_t deque_filo<T>::size() const
{
	lock guard(mutex_);
	return storage_.size();
}

template<class T>
size_t deque_filo<T>::reset()
{
	lock guard(mutex_);
	storage_.clear();
}

}

#endif /* DEQUE_FILO_HPP_ */
